import java.util.ArrayList;

public class Play{
	
	private ArrayList rangs = new ArrayList();	
	protected Deck sabot;
	
	public Play(){	
	}

	public void takeCard(ArrayList<Carte> hand){
		Carte card = sabot.pop();
		hand.add(0, card);
	}
	
	public int calculateValue(ArrayList<Carte> hand){
		int m = 0;
		for (int i=0; i<hand.size(); i++){
			Carte card = hand.get(i);
			m=m+card.getValeur();
		}
		return m;
	}
	
	public boolean containsRank(int i, ArrayList<Carte> hand){	
	for (int k=0; k<hand.size(); k++){
			Carte card = hand.get(k);
			int r = card.getRang();
			rangs.add(k, r);
			}
	return rangs.contains(i);
	}
}

